package com.espirit.eap.manager;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;

import org.hibernate.annotations.BatchSize;

import com.espirit.EntityMapping;
import com.espirit.eap.annotation.DomainModel;
import com.espirit.eap.annotation.ModelDisplayProperty;
import com.espirit.eap.sa.LocalScopeAware;
import com.googlecode.cswish.model.Saas;

@Entity
@DomainModel
@ModelDisplayProperty(value = "name")
@BatchSize(size=10)
public class Department extends EntityMapping  implements LocalScopeAware ,Serializable, Saas {
	private static final long serialVersionUID = -7074473750739345515L;
	
	public Department(){
		super();
	}
	public Department(String parentId) {
		super();
		setId(parentId);
	}
	
	private Integer sid;
	public Integer getSid() {
		return sid;
	}

	public void setSid(Integer sid) {
		this.sid = sid;
	}
	
	private String name;
	private String parentId;
	private String parentName;

	@Transient
	public String getParentName() {
		return parentName;
	}
	public void setParentName(String parentName) {
		this.parentName = parentName;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	
	private String childIds;
	private String childrenIds;

	@Column(length=20000)
	public String getChildIds() {
		return childIds;
	}
	public void setChildIds(String childIds) {
		this.childIds = childIds;
	}
	
	@Column(length=20000)
	public String getChildrenIds() {
		return childrenIds;
	}
	public void setChildrenIds(String childrenIds) {
		this.childrenIds = childrenIds;
	}

	
//	@Override
//	public String[] gatherProperties() {
//		return new String[]{"name"};
//	}

}
